package com.example.weibo_app.service.impl;

import com.example.weibo_app.domain.Banner;
import com.example.weibo_app.mapper.BannerMapper;
import com.example.weibo_app.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements BannerService {

    @Autowired
    private BannerMapper bannerMapper;

    @Override
    public int addBanner(Banner banner) {
        return bannerMapper.insertBanner(banner);
    }

    @Override
    public int updateBanner(Integer id) {
        return bannerMapper.updateBanner(id);
    }


    @Override
    public List<Banner> getAllBanners() {
        return bannerMapper.selectAllBanners();
    }
}

